﻿#region Copyright information
// 
// Copyright © 2005-2013 Yongkee Cho. All rights reserved.
// 
// This code is a part of the Biological Object Library and governed under the terms of the
// GNU Lesser General  Public License (LGPL) version 2.1 which accompanies this distribution.
// For more information on the LGPL, please visit http://bol.codeplex.com/license.
// 
// - Filename: ConfidenceInterval.cs
// - Author: Yongkee Cho
// - Email: yongkeecho@gmail.com
// - Date Created: 2012-09-06 11:39 AM
// - Last Modified: 2013-01-25 3:59 PM
// 
#endregion
using System;

namespace BOL.Maths.Statistics
{
    public struct ConfidenceInterval
    {
        #region Public properties

        public double Min { get; private set; }

        public double Max { get; private set; }

        #endregion

        #region Constructor

        public ConfidenceInterval(double min, double max)
            : this()
        {
            if (max > min)
            {
                Min = min;
                Max = max;
            }
            else
            {
                Min = max;
                Max = min;
            }
        }

        #endregion

        #region Object overriden

        public override string ToString()
        {
            return String.Format("[{0:0.0000}, {1:0.0000}]", Min, Max);
        }

        #endregion
    }
}
